package com.peter.framework.service.memcache;

import com.google.appengine.api.memcache.Expiration;
import com.google.appengine.api.memcache.MemcacheService;
import com.google.appengine.api.memcache.MemcacheServiceFactory;
import com.google.inject.Singleton;

@Singleton
public class GoogleLLCacheService implements CacheService {

	@Override
	public Object get(String key) {
		MemcacheService memcacheService = MemcacheServiceFactory
				.getMemcacheService();
		return memcacheService.get(key);
	}

	@Override
	public void put(String key, Object value) {
		MemcacheService memcacheService = MemcacheServiceFactory
				.getMemcacheService();
		memcacheService.put(key, value, Expiration.byDeltaSeconds(120));
	}

}
